<table>
    <thead>
        <tr>
            <th>序号</th>
            <th class="operations" *ngIf="option.operations?.length>0">操作</th>
            <ng-container *ngFor="let item of _columns">
                <th [ngStyle]="{'width.px': item.width}">{{item.title}}</th>
            </ng-container>
            <th class="select" *ngIf="option.selectType">选择</th>
        </tr>
    </thead>
    <tbody cdkDropList [cdkDropListDisabled]="option.dropListDisabled" (cdkDropListDropped)="action('trDrop', _resultList.list, $event)" [ngClass]="{'batch':option.type === 'batch'}">
        <tr *ngIf="_resultList.list.length===0">
            <td class="no-data" [attr.colspan]="_columnLength">{{option.noData}}</td>
        </tr>
        <tr cdkDrag *ngFor="let item of _resultList.list; index as i" (click)="action('trClick', item)">
            <td>{{(option.query.size*(option.query.index-1)+i+1) | nmCover}}</td>
            <td class="operations" *ngIf="option.operations?.length>0">
                <span *ngFor="let operation of option.operations" [title]="operation.title" class="{{operation.icon}}"
                    (click)="handler(operation, item)" [action]="operation.action" [hidden]="true"></span>
            </td>
            <ng-container *ngFor="let col of _columns">
                <ng-container *ngIf="option.type=='info'">
                    <td [innerHtml]="setTdValue(item[col.key])"></td>
                </ng-container>
                <ng-container *ngIf="option.type=='batch'">
                    <td>
                        <nm-control [option]="col.control" [(ngModel)]="item[col.key]"></nm-control>
                    </td>
                </ng-container>
            </ng-container>
            <td class="select" *ngIf="option.selectType">
                <nm-checkbox [(ngModel)]="item.$selected" (click)="action('checkbox', item, $event)"></nm-checkbox>
            </td>
        </tr>
    </tbody>
</table>
<nm-pagination #pagination [option]="_resultList"></nm-pagination>